package com.edooteach.api.dao;

import java.util.List;
import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.edoomath.entity.course.Course;
import com.edoomath.entity.mall.Sku;

/**
 * @author xiaoHU
 *
 */
@Dao(value = "hibernate")
public interface CourseDao {
    
    /**
     * @param courseIds
     * @return
     */
    @Query("SELECT sc.course FROM SkuCourse sc WHERE sc.disabled = false AND sc.sku = :sku")
    public List<Course> listBySku(@Variable("sku") Sku sku);
    
    /**
     * @param bookIds
     * @return
     */
    @Query("FROM Course WHERE disabled = false AND id in :courseIds")
    public List<Course> listByIds(@Variable("courseIds") List<Long> courseIds);

}
